<template>
	<view class="sp-section sp-field">
		<!-- 栏位照片 -->
		<view class="sp-field__image">
			<image :src="info.image + '?x-oss-process=image/resize,m_fixed,w_430'" mode="widthFix"></image>
		</view>
		
		<!-- 栏位详情 -->
		<view class="sp-field__info">
			<view class="sp-field__info-name">{{ build[info.building_id] }} - {{ info.column_name }}</view>
			<view class="sp-field__info-desc">刷新时间: {{ info.operation_time }}</view>
			<view class="sp-field__info-person">阶段: {{ info.stage }}</view>
			<view class="sp-field__info-person">胎次: {{ info.baby_count }}</view>
			<view class="sp-field__info-person">评分: {{ info.score }}</view>
		</view>
	</view>
</template>

<script>
	import { file } from '@/api/task.js'
	
	export default {
		name: 'spIndex',
		components: {},
		data () {
			return {
				file,
				info: {},
				build: {}
			}
		},
		onLoad (option) {
			this.info = JSON.parse(option.info)
			console.log('拍照信息', this.info)
			const build = uni.getStorageSync('build')
			build.forEach(item => {
				this.build[item.id] = item.farm_name
			})
		},
		onShow () {},
		created () {},
		mounted () {},
		methods: {},
		onPullDownRefresh () {},
		onShareAppMessage () {}
	}
</script>

<style lang="less" scoped>
	.sp-field__image {
		width: 100%;
		margin: 0 auto;
	}
</style>
